package com.xigua.volatileDemo;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2021/12/2310:57
 */
public class VolatileThreadDemo {
    public static void main(String[] args) {
        VolatileThread volatileThread = new VolatileThread();

        volatileThread.start();

        while (true){
            synchronized (volatileThread){
            if (volatileThread.getFlag()){
                System.out.println("=============");
            }
            }
        }

    }
}
